package com.myshop.b2b.commonmodule;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

/**
 * @author likaiping
 * @createTime 2024/7/2 16:59
 */
/**
 * @TableName cart
 */
@TableName(value ="cart")
public class Cart implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     *
     */
    private String goodsname;

    /**
     *
     */
    private Integer number;

    /**
     *
     */
    private Integer price;

    /**
     *
     */
    private Integer goodid;

    /**
     *
     */
    private Integer uid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    public Integer getId() {
        return id;
    }

    /**
     *
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     *
     */
    public String getGoodsname() {
        return goodsname;
    }

    /**
     *
     */
    public void setGoodsname(String goodsname) {
        this.goodsname = goodsname;
    }

    /**
     *
     */
    public Integer getNumber() {
        return number;
    }

    /**
     *
     */
    public void setNumber(Integer number) {
        this.number = number;
    }

    /**
     *
     */
    public Integer getPrice() {
        return price;
    }

    /**
     *
     */
    public void setPrice(Integer price) {
        this.price = price;
    }

    /**
     *
     */
    public Integer getGoodid() {
        return goodid;
    }

    /**
     *
     */
    public void setGoodid(Integer goodid) {
        this.goodid = goodid;
    }

    /**
     *
     */
    public Integer getUid() {
        return uid;
    }

    /**
     *
     */
    public void setUid(Integer uid) {
        this.uid = uid;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Cart other = (Cart) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getGoodsname() == null ? other.getGoodsname() == null : this.getGoodsname().equals(other.getGoodsname()))
                && (this.getNumber() == null ? other.getNumber() == null : this.getNumber().equals(other.getNumber()))
                && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
                && (this.getGoodid() == null ? other.getGoodid() == null : this.getGoodid().equals(other.getGoodid()))
                && (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodsname() == null) ? 0 : getGoodsname().hashCode());
        result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getGoodid() == null) ? 0 : getGoodid().hashCode());
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", goodsname=").append(goodsname);
        sb.append(", number=").append(number);
        sb.append(", price=").append(price);
        sb.append(", goodid=").append(goodid);
        sb.append(", uid=").append(uid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}

